package lois;

public class LoiGeom extends Loi {
	private double p;
	
	public LoiGeom(double p) {
		this.p = p;
	}
	
	public double generer() {
		return fonctionInverse(Math.random());
	}
	
	private double fonctionInverse(double param) {
		return 1D/(1D - Math.pow(1D - p, param));
	}

}
